package dviz.visualAspect;

import java.util.HashMap;

/**
 * @author  zxq071000
 */
public class Invokation {
	/**
	 * @uml.property  name="context"
	 */
	private Object context;
	// private HashMap<Param, Object> parameters;
	// private FunctionMap functionMap;
	// private ConstructMap constructMap;
	// private ObjectMap objectMap;

	/**
	 * @uml.property  name="type"
	 */
	private int type;

	public static final int TYPE_CONSTRUCTOR = 0;

	/**
	 * @return
	 * @uml.property  name="actionName"
	 */
	public String getActionName() {
		return actionName;
	}

	/**
	 * @param actionName
	 * @uml.property  name="actionName"
	 */
	public void setActionName(String actionName) {
		this.actionName = actionName;
	}

	public static final int TYPE_METHOD = 1;

	/**
	 * @uml.property  name="actionName"
	 */
	public String actionName;
	/**
	 * @uml.property  name="className"
	 */
	public String className;
	/**
	 * @uml.property  name="visualObject"
	 */
	public String visualObject;
	/**
	 * @uml.property  name="parameters"
	 */
	public HashMap<String, Object> parameters;
	/**
	 * @uml.property  name="constructType"
	 */
	public String constructType;

	/**
	 * @return
	 * @uml.property  name="context"
	 */
	public Object getContext() {
		return context;
	}

	/**
	 * @param context
	 * @uml.property  name="context"
	 */
	public void setContext(Object context) {
		this.context = context;
	}

	/**
	 * @return
	 * @uml.property  name="type"
	 */
	public int getType() {
		return type;
	}

	/**
	 * @param type
	 * @uml.property  name="type"
	 */
	public void setType(int type) {
		this.type = type;
	}


	/**
	 * @return
	 * @uml.property  name="className"
	 */
	public String getClassName() {
		return className;
	}

	/**
	 * @param className
	 * @uml.property  name="className"
	 */
	public void setClassName(String className) {
		this.className = className;
	}

	/**
	 * @return
	 * @uml.property  name="visualObject"
	 */
	public String getVisualObject() {
		return visualObject;
	}

	/**
	 * @param visualObjectName
	 * @uml.property  name="visualObject"
	 */
	public void setVisualObject(String visualObjectName) {
		this.visualObject = visualObjectName;
	}

	/**
	 * @return
	 * @uml.property  name="parameters"
	 */
	public HashMap<String, Object> getParameters() {
		return parameters;
	}

	/**
	 * @param parameters
	 * @uml.property  name="parameters"
	 */
	public void setParameters(HashMap<String, Object> parameters) {
		this.parameters = parameters;
	}

	/**
	 * @return
	 * @uml.property  name="constructType"
	 */
	public String getConstructType() {
		return constructType;
	}

	/**
	 * @param constructType
	 * @uml.property  name="constructType"
	 */
	public void setConstructType(String constructType) {
		this.constructType = constructType;
	}

	@Override
	public String toString() {
		if (type == TYPE_CONSTRUCTOR) {
			return "[" + visualObject +"@"+className+ "] Constructor";
		} else if (type == TYPE_METHOD) {
			return "[" + visualObject +"@"+className + "]->" + actionName;
		}
		return "";
	}
}
